package com.ruoyi.repn.controller.front;

import com.ruoyi.common.annotation.RepeatSubmit;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.repn.domain.ReportInfo;
import com.ruoyi.repn.domain.params.EnterpriseInfoParams;
import com.ruoyi.repn.service.ThirdPartyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * @author cpf
 * @date 2024/3/4 13:56
 * @description 第三方接口
 */
@RestController
@RequestMapping("front/third/party")
public class ThirdPartyController {

    @Autowired
    private ThirdPartyService thirdPartyService;

    /**
     * 查询企业信息
     * @param enterpriseInfoParams
     * @return
     */
    @RepeatSubmit  //防止重复提交
    @GetMapping("/getEnterpriseInfo")
    public AjaxResult getEnterpriseInfo(EnterpriseInfoParams enterpriseInfoParams){
        return thirdPartyService.getEnterpriseInfo(enterpriseInfoParams);
    }




    /**
     * 验证手机号和身份证
     * @param report
     * @return
     */
    @RepeatSubmit  //防止重复提交
    @PostMapping("/checkId")
    public AjaxResult isPhoneAndCard(@Validated  @RequestBody ReportInfo report){
        return thirdPartyService.isPhoneAndCard(report);
    }


}
